package com.yxy.f_music_server.controller.mobile;

import com.yxy.f_music_server.common.PageResult;
import com.yxy.f_music_server.common.Result;
import com.yxy.f_music_server.constant.RequestMapperConstant;
import com.yxy.f_music_server.domain.dto.SongPageQueryDTO;
import com.yxy.f_music_server.domain.po.Song;
import com.yxy.f_music_server.service.MusicService;
import com.yxy.f_music_server.utils.FileCopyUtil;
import com.yxy.f_music_server.utils.QiniuOSSUtil;
import com.yxy.f_music_server.utils.SongUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController("mobileMusicController")
@RequestMapping(RequestMapperConstant.MOBILE_REQUEST_MAPPER + "music")
@Slf4j
public class MusicController {

    @Autowired
    private MusicService musicService;

    /**
     * 获取音乐列表
     *
     * @param songPageQueryDTO
     * @return
     */
    @GetMapping
    public Result<PageResult> getMusicList(SongPageQueryDTO songPageQueryDTO) {
        log.info("搜素音乐：{}", songPageQueryDTO);
        PageResult pageResult = musicService.getMusicList(songPageQueryDTO);
        return Result.success("", pageResult);
    }
}
